home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1446 / smallreg.txt < prev   
Text File  |  1997-02-04  |  35KB  |  242 lines

  1. Compressing the Win95 Registry Ver 3.0
  2. by  Roy Lehrer
  3. CompuServe ID:    76534,1122
  4. Internet e-mail:  roy@soon.com
  5.  
  6.  
  7.  
  8. As you may have noticed, the Win95 registry files (system.dat & user.dat) and of course their backups (system.da0 & user.da0) keep growing in size and never shrink no matter what has been removed from the registry.
  9.  
  10. Other "hacks" have been previously published on how to use the real mode portion of regedit.exe to compress the registry using the "regedit /c" command from the dos prompt.  The only problem is that it will not always work with the original Win95 
  11.    NOTE:  It appears that this registry editor problem has been corrected in the regedit.exe programs that are supplied with osr2 and Memphis.  See Appendix A
  12. Most users think this problem is because their registry has grown too large for the real mode regedit to handle, but this is not entirely true.  The problem is not so much the size of the registry files themselves, but due to the size of individual keys within the registry exceeding what the real mode regedit can handle. This has been documented in an article that can be found in the Microsoft Knowledge base (a copy of it is included with this archive as Q132064.TXT).
  13.  
  14. The purpose of this procedure is to overcome this problem and allow you to compress your registry with out the above mentioned limitations. In a nutshell, this is done by starting Win95 with a very minimum registry that is created from a DOS Prompt using the real mode portion of regedit.exe, and then using the Win95 GUI portion of regedit.exe to restore the complete registry.  The size reduction can be amazing, but keep in mind that the size reduction is directly related to what has been removed from the registry (removed programs and/or hardware). I have been using this procedure for over a year and a half and have NEVER, I repeat NEVER, experienced any problems with it. If you decide to proceed you are doing so AT YOUR OWN RISK.  (The procedure does prompt you to make backup copies of all critical files).
  15.  
  16. Of all the problems reported to me since I posted the original version of this procedure, all but three were a result of the user not following this procedure to the letter.  In each case a user tried taking a shortcut or did something a little different.  So, please follow this procedure step by step doing exactly what each step calls for.  Responses from users have confirmed that a very minor deviation from the procedure will cause major problems.
  17.  
  18. This procedure does not provide a one-time fix-all, no procedure can.  As you continue to use your system, the registry will again grow in size (this is a function of how Win95 operates).  You can re-run this procedure whenever you feel the need to.  As a matter of fact, this procedure provided NO fixes, it just eliminates the wasted space in your registry.  If you have registry problems before running this procedure, they may very will exist afterwards.
  19.  
  20. My Win95 installation is set up for a single user and so is this procedure.  A single user system does not have user profiles.  A system can be setup as a multi user system and still have only one user.  To determine if your system is setup as a single user (no profiles) or multi user (profiles) do the following:
  21.  
  22. 1.  Open up Control Panel
  23. 2.  Double click on Passwords to open it and one of the following choices will be checked:
  24. (a)  "All users of the PC use the same preferences and desktop settings" is checked, then your are not using profiles and this procedure should work.
  25. (b)  "Users can customize their preferences and desktop settings.  Windows switches to your personal settings whenever you log in." 
  26.  3.  If  (a) is checked you are setup as a single user.  If (b) is checked you are not.
  27.  
  28. If you have a multiple user setup this procedure will not work as written, but it should at least give you an idea of what needs to be done, see Appendix B for additional information.
  29.  
  30. This procedure may not be for the novice.  In some steps, I may not completely explain how to do each function, I only tell you what function to perform.  If you do not know how to perform a particular function then maybe you think twice before performing this procedure.
  31.  
  32. For the purpose of this procedure the term "DOS prompt" refers to a real dos prompt from real DOS itself not the prompt you get from within a Win95 DOS window.  The term "WinDOS prompt" will be used to refer to the prompt you get from within a Win95 DOS window.
  33.  
  34. Additionally, this procedure is written with the assumption that you installed Win95 to the normal default directory of C:\Windows.  If you installed it elsewhere, then you must make appropriate changes to the commands given in this procedure.  For example if you installed to D:\Win95 then change all of my C:\Windows..... references to D:\Win95......
  35.  
  36. You must also have a copy of the Microsoft Win95 Registry Editor (regedit.exe) installed (it should have automatically installed when you installed Win95).  DO NOT use other registry editors.  I know for a FACT that some of them have (or had) problems in saving .reg files in the proper format, which will prevent this procedure from working.  Regedit.exe should be in your windows directory, if you moved it somewhere else, then you will have to preface any command used in this procedure for regedit with the path to where you installed it (i.e. c:\util\regedit).  
  37.  
  38. This procedure works using either COMMAND.COM or 4DOS.COM as your command processor.
  39.  
  40. With all that said, if I haven't scared you off yet, here is the procedure.  PROCEED AT YOUR OWN RISK.
  41.  
  42. 1.  Start Win95, then make backup copies of the following files (if they exist) to a directory on your hard disk. Next to each file name, in parenthesis, I have included its attributes.  You may need to change them to make a backup, depending on what software you are using to make the copies.  If all goes well, you should not have to restore any of these files, but it never hurts to have backups.  If you have trouble with the procedure, restoring these files should restore your system to the same state as it was before you started. In the following list, msdos.sys should be in your root directory (if using a compressed drive, it should be on your host drive), all other files should reside in your windows directory (if they exist, not all users will have all of the listed files).
  43. a.  msdos.sys (System, Read Only, Hidden)
  44. b.  system.dat (System, Read Only, Hidden)
  45. c.  system.da0 (System, Read Only, Hidden)
  46. d.  user.dat (System, Read Only, Hidden)
  47. e.  user.da0 (System, Read Only, Hidden)
  48. f.  system.ini 
  49. g.  win.ini
  50. h.  ShellIconCache (Hidden).  Note: This file must be copied from within Win95 or at a 
  51.      WinDOS prompt to keep the long file name intact
  52. i.  system.cb
  53. j.  ios.log
  54. k.  ttfcache (Hidden)
  55. Note:    I have included SMALLBAC.BAT, a quick and dirty batch file I wrote to make a backup of the above listed files (if they exist) to a directory called SmallReg that will be created as a subdirectory to your windows directory.  It should be run from a WinDOS prompt (to keep the LFN of ShellIconCache intact).  The syntax is "SMALLBAC drive:" where 'drive:' is the drive letter with colon that contains the msdos.sys file, which may or may not be on the same drive that contains your Win95 files.  The location of your windows directory is obtained from the system variable %windir% which is set by Win95 during the boot cycle.  The files copied to this directory will have no attributes set.  The attributes of all original files, although removed to allow copying, will be restored to those listed above. Minimal error checking is performed.  If your installation is unique or uses compressed drives, this batch file may not work without modifications, but if tried, it should cause no problems other than to leave you with a SmallReg directory that may be empty or only contain a partial backup of the above files.  If you run this batch file more than once, or already have a directory named SmallReg, you will see an error message stating that it could not create the directory, this is because it already exists, but will cause no problems.  When the batch file completes, it displays the SmallReg directory, check to make sure that all of the above files (if they exist on your system) are there
  56. 2.  This procedure is based on booting to the DOS (or 4DOS) prompt not the GUI interface, therefore if you DO NOT already boot to the DOS prompt (as is the case for most users) you may modify the [Options] section of your MSDOS.SYS file by first removing the System, Read Only and Hidden attributes from it and then editing it to change the BOOTGUI=1 line to BOOTGUI=0 (if you do not have a BOOTGUI=1 line just add the BOOTGUI=0 line).  This will cause booting to the DOS prompt instead of the GUI interface.  If you want you can optionally add the line LOGO=0 which will prevent the startup Win95 "clouds" picture from displaying and let you see what is going on during your boot cycle, including any error messages that may have been hidden from your view by the clouds.  After making the modifications, restore the System, Read Only and Hidden attributes to this file.  
  57. Alternatively, if you do not want to modify your MSDOS.SYS file, you can press F8 each time you boot and select the menu option for "Command Prompt Only".  This will have to be done for each boot, and you will have to make adjustments in some of the steps, since they are written for a modified MSDOS.SYS file.
  58. 3.  Check your windows directory for any files that begin with the letters LOGO and have a .SYS extension.  If you have any, you must rename each of them.  Just change the extension to something like. ORG.  If you have problems, check the file attributes and change them as necessary.  This is necessary, so that when you exist from Win95, you will get a DOS prompt.
  59. 4.  In the taskbar, click on Start then Shutdown, make sure "Shut down the computer" is selected and click on YES to exit Win95.
  60. 5.  Re-boot your system and you should boot to a real DOS prompt, just like the good old days.
  61. 6.  From the DOS prompt type WIN to start Win95. 
  62. 7.  Edit your registry as desired to get it the way you want it. If your going to compress it, you might as well get rid of the junk first.  After editing my registry to remove what I do not want (all the run MRU, Document and other history lists, leftovers from removed programs, etc.), I run both Regclean ver 2 and 3 on my registry to clean it up before proceeding.  I have found that ver 2 will delete useless nummethods and baseinterface keys that ver 3 doesn't.  I also know that some users have reported problems using these Microsoft programs, but I have never experienced any problems using them.
  63. Note1:    If you do use regclean.exe ver 3 - I suggest that you DO NOT select "Empty key check" under the Options - Interface tab.  Doing so will result in deletion of "empty" keys that are actually used by some programs.  Active Movie is an example of a program that will not run properly if certain "empty" keys are deleted.
  64. Note2:    I have included the file SMALLREG.INF (complete with comments) with this archive, its use is completely optional and AT YOUR OWN RISK.  It will remove many of the MRU, Recent Files, Recent Docs, History Lists, etc., which Win95 created in your registry.  It also does the same for some other popular programs.  If you look at it with a text editor you can see which registry entries it will delete.  This file can be edited with a text editor so you can add or delete entries as you wish to adjust what will be removed from your registry.  Leaving in entries for items you don't have will do no harm (it can't delete what doesn't exist).  All of the keys that this inf file deletes are keys that are self creating and will return as needed. To execute it, locate it with explorer, and double click on it.  If you have modified your associations for INF files types, then right click on it and select the appropriate command (usually RUN or INSTALL).  If you like what SMALLREG.INF does, you can create a shortcut to it your startup folder and it will run each time that you start Win95 and delete the MRU's, History Lists, etc., that were created in your previous Win95 session.  As supplied this file ends with a string of 10 CTRL Z's.  I have found that most INF files execute faster if there are a few CTRL Z's at the end of the file. These CTRL Z's will probably look like a string of little boxes at the end of the file, just leave them there.  Based on information that I have supplied, an upcoming PC Magazine's User-to-User column, should be providing more information on using a "registry only" inf files to delete unwanted items from the registry. 
  65. Note3:    The older regclean (ver 2) was originally supplied with Visual Basic 3.0 and was available for downloading from various sites, including Microsoft.  Since the release of VB4 most, if not all, of the sites now only offer ver 3 for downloading.  Try going to http://filez.com/ and doing a search for "regclean.exe" or  "regclean.zip" and you may find it.  This search will also include findings for ver 3, however if you find a search result that is only about 250K it is probably ver 2, since the complete ver 3 is about 1.5MB.   Other than this I can offer no other help in obtaining ver 2 if you don't have it.
  66. 8.  Start regedit, highlight MY COMPUTER and export it to a file named ALL.REG in your windows directory.  This file will really only contain the keys HKEY_LOCAL_MACHINE and HKEY_USERS, which is all that is really needed.  The other registry keys are either derived from the contents of these two keys or are dynamically created during a Win95 session.
  67. 9.  Double click on the key HKEY_USERS to expand it.
  68. 10.  Double click on each of the keys that have just come into view to expand them.  You may have only a ".DEFAULT" key to expand or you many have others depending on what has been installed on your system.
  69. 11.  Right click on ANY the keys now visible under HKEY_USERS named SOFTWARE and select delete from the pop-up menu.  Answer YES to the prompt "Are you sure you want to delete this key?"  You may have one or more keys labeled SOFTWARE, again this depends on what you have installed on your system. Delete all of them.
  70. 12.  Highlight HKEY_USERS and export it to a file named HKU.REG in your windows directory.  
  71. Note:    This file will be used to make the minimal registry mentioned earlier.  The data that was in the SOFTWARE key(s) that you deleted is not needed for this minimal registry and will be restored via ALL.REG later in this procedure. The reason for deleting these keys is to eliminate the possibility of individual key values that can exceed the size limitations of the real-mode portion of regedit.
  72. 13.  Exit regedit
  73. 14.  In the taskbar, click on Start then Shutdown, make sure "Shut down the computer" is selected and click on YES to exit to a DOS prompt.  You should exit to a real DOS prompt.  If you do not get to the DOS prompt, just reboot to DOS and proceed.
  74. 15.  From the DOS Prompt, change to the directory that contains the system.dat and user.dat files.  This is normally the C:\WINDOWS directory.
  75. 16.  Enter the command "regedit /c hku.reg" (without the quotes).  This creates a new registry (over writing your original, so make sure you made the backup per step 1) with only the keys from HKEY_USER.  This creates our minimum registry.  It will be minimal in size, but more importantly, none of the individual keys within it SHOULD exceed the real mode regedit's capabilities, and it will contain just enough info to allow us to re-start Win95 and re-create a complete registry.  This is the key to being able to compress any registry regardless of size.
  76. 17.  Reboot your computer pressing F8 when the starting win95 message appears.  From the displayed menu select the choice for plain "SAFE mode" (usually option 3). DO NOT select "Safe mode command prompt only" as this mode will not allow you to enter Win95 in the next step.
  77. 18.  From the DOS Prompt type WIN to start Win95
  78. 19.  When you get the message telling you that you are running in safe mode, click on OK
  79. Note:    When Win95 starts, all your desktop icons and other display items will look different/strange, just ignore it and follow the steps in this procedure to the letter.  Let me also tell you that since you are now running with a registry that was made up of minimal information, many functions will not work, including links, because no associations exist.  For this reason you will be unable to double click on anything to get it to run (which you should not be doing anyway).  Remember just follow the steps as written.  Telling you about this is just my way of giving you an idea of what's going on, not an invitation to go exploring.
  80. 20.  If you normally operate with an "auto hide" taskbar, then right click on the taskbar, select properties and set the auto hide property, then click OK
  81. 21.  In the taskbar, click on Start then Run and enter "regedit all.reg" (without the quotes), (if either regedit or all.reg is not in your windows directory, then preface them with the correct path) then click the OK button. Wait (it may take a little while depending on your old registry size and processor speed), for the message "Information in all.reg has be successfully entered into the registry", then click on the OK button.  This will read all of your original registry entries back into the new registry you are creating, thus creating a new complete, yet compressed registry.
  82. 22.  In the taskbar, click on Start then Shut down, make sure "Shut down the computer" is selected and click on YES to exit to a DOS prompt.
  83. 23.  Reboot your computer to a DOS prompt
  84. 24.  From the DOS Prompt type WIN to start Win95
  85. Note:    This time your display should look normal, except for the recycle bin if you use Norton Utilities.  If you use Norton Utilities, and the recycle bin is not being displayed properly, right click on it, select properties, then the Desktop Item tab, first clear then re-check the Show Norton Protection status box, then click on OK. The recycle bin should now be displayed properly.
  86. 25.  Go to a WinDOS Prompt by clicking on Start, then Run, and enter "command" (without the quotes), then click on OK.  As soon as the WinDOS window appears, close it.  This action makes Win95 automatically complete the rebuilding of the [TTFontDimenCache] section of your system.ini file.
  87. 26.  At this point you have an option.  You can restore shelliconcache from the backup copy you made in step 1h (don't forget to set the hidden attribute), or you can just forget about it and Win95 will automatically rebuild it at some time in the future. If you select the later, the rebuild can be "initiated" by just booting to safe mode and then exiting (after you complete this procedure).
  88. 27.  To restore your MSDOS.SYS file (which is optional) just reverse what you did in step 2. If you prefer to see what is going on during the boot-up you can leave the LOGO=0.  If you prefer the Win95 "clouds" picture you can change it to LOGO=1 or just delete this line. If you like this method of booting but would still like to automatically start Win95 each time you boot, you can leave MSDOS.SYS as is and add line to the end of your autoexec.bat file that contains just the word WIN.  You could also do this and change/delete LOGO=0 if you like to see the "clouds". If you make changes to MSDOS.SYS, don't forget to set the System, Read Only and Hidden attributes when your done.
  89. 28.  If you renamed any LOGO*.SYS files in step 3, restore their original names. If you do not rename them you will probably always exit to a DOS Prompt instead of seeing the shutdown screens when you exit Win95.  You can try leaving them renamed to see if you like it, if you don't then you can always restore the *.sys filename extension later.
  90. 29.  In the taskbar, click on Start then Shutdown, make sure "Shut down the computer" is selected and click on YES to exit to a DOS prompt.  This last shutdown is necessary to complete the rebuilding of TTFCACHE and to do some cleanup.
  91. 30.  If you use Norton Utilities, change to your windows directory then enter "dir nps*.ico" (without the quotes).  If more than 2 files show up, delete all but the 2 with the most recent date/time stamps. Or you can just delete them all and repeat the procedure in the step 24 Note the next time you start Win95. These nps*.ico files are just the icons Norton uses to display the recycle bin. They get re-written just about every time you empty the recycle bin, or the first time something is added to an empty recycle bin, so deleting all of them does no harm, you just have to remember to repeat the step 24 Note procedure to get things back in sync.
  92. 31.  Change to your windows directory and enter "del win386.swp" (without the quotes). Regardless of the type of swap file you normally use, this file was created as 0 bytes in size during the SAFE mode startup with minimum registry.  A new swap file will be created using your original swap file settings the next time you start Win95.
  93. 32.  You MAY also delete the ALL.REG and HKU.REG files that were exported to this directory. 
  94. I have found that if you immediately re-run this procedure a second time, further registry size reduction sometimes occurs.  Running this procedure on a regular basis, I have come across occasions where the new SYSTEM.DAT file is actually larger than the old one (USER.DAT is smaller).  When this happens, running this procedure the second time is necessary and the results have always been a SYSTEM.DAT file that is smaller than the original.  I don't know why this happens so I can not provide the details, I only know that it happens and how I fix it.
  95. You're done and your registry files should be smaller than before.  If everything is working OK, after a few days, you can delete the backups you made in step 1.
  96.  
  97. If you should experience problems, try the following:
  98. 1.  Restore from the backups made in step 1, which should restore your system to the way it was before starting this procedure.
  99. 2.  Make sure that you can properly boot to safe mode and exist from it without errors.
  100. 3.  Re-run the procedure again, paying special attention to make sure that MY COMPUTER is highlighted when you save all.reg in step 8.
  101. 4.  Again restore from the backup and re-run the procedure, but this time skip steps 9, 10, and 11.  With these steps skipped it is possible that you will get an error message in step 16, but not all users will, so it is worth trying.  If you get an error message, stop here and restore from your backups.
  102. 5.  Send me an e-mail with 
  103. a.  The version of this procedure that you are using.
  104. b.  The EXACT specifics of the problem, referencing the specific step you were performing.  I need exact error messages, please.  If you generalize, then I may not be able to assist.
  105. c.  Let me know your level of "expertise" so that I can tailor a reply accordingly.  
  106.  
  107. If you are a CompuServe member send your e-mail to my CompuServe address. 
  108. 76534,1122 
  109. If you use the Internet send e-mail to my Internet address.  
  110.     roy@soon.com
  111.  
  112. I check both locations daily. Sending e-mail to me as described above will make it easier for me to respond, especially if I need to include an attachment.  If you choose to ignore my request and send e-mail "cross platform" don't expect a response.
  113.  
  114. Appendix  A - osr2/Memphis
  115.  
  116.  
  117. The registry editors (regedit.exe) supplied with osr2 and Memphis do not exhibit the problems that the original Win95 regedit.exe has when running in real mode.  So if you have either osr2 or Memphis installed skip on down to the "How to compress" section.
  118. The drawback for Win95 users is that even if they obtained a copy of the osr2 or Memphis regedit.exe program, neither will run on a normal Win95 system.  The reason is that both osr2 and Memphis are supplied with DOS ver 7.1 and Win95 comes with DOS 7.0.  The regedit programs supplied with either osr2 or Memphis check to see which version of DOS is running and refuses to start, if it is not ver 7.1
  119. As far as I know, Microsoft has not posted this file for download, although I don't know why they just don't add it to there updates page.  If anyone finds a place to download it from please let me know.  However, if you do have the program, here are two ways to overcome this problem.
  120. Fix 1:    From a DOS prompt enter the following command: 
  121.          SETVER REGEDIT.EXE 7.10
  122. This will cause DOS to report ver 7.10 to regedit.exe as long as setver has been loaded into memory, which it normally is (even if you didn't know it) when you boot from your hard disk.  The problem with this method is that if you boot from a diskette, which normally does not load setver into memory, regedit will not work.  You must reboot for the changes to take effect
  123. Fix 2:    My preferred method is to patch either osr2 or Memphis versions of REGEDIT.EXE so that it thinks ver 7.10 is running even if it's not. This has the advantage of eliminating the need for setver to be running and it runs on any version of DOS (I have tested it on ver 7.0 and 6.2x). 
  124. This is done by simply changing the code that gets the version information from:
  125.         MOV    AH,30h    ; Get DOS Version Number function
  126.         INT       21h        ; DOS call to execute this function
  127. To code that will load register AX with what should have been returned when the above code was executed.
  128.         MOV   AX,0A07h    ; Loads AX with 0A07 (ver 7.10)
  129.         NOP            ; No operation
  130.  
  131. Note 1:  Just NOP'ing the code will not work because a number of decisions are made based on the contents of AX, therefore AX must contain the correct value.
  132. Note 2:    This needs to be done in two different places where regedit.exe does a version check.
  133. To apply this patch use a hex editor (debug will not work) and make the change listed below, making sure to use the address that corresponds to the version of regedit.exe that you are patching:
  134. Memphis          osr2        Original    Patch
  135. Address        Address     Value        Value
  136.  
  137.     2B6A        2B52          B4          B8
  138.      2B6B        2B53          30          07
  139.      2B6C        2B54          CD          0A
  140.      2B6D        2B55          21          90
  141.  
  142.      339C        3384          B4          B8
  143.      339D        3385          30          07
  144.      339E        3386          CD          0A
  145.      339F        3387          21          90
  146.  
  147.  
  148. HOW TO COMPRESS - Single User System:
  149. Note:  Where attributes are changed and not restored, it is because they will automatically be restored by regedit as the procedure continues.
  150. 1.  Optionally, remove any "deadwood" from your registry.
  151. 2.  Exit Win95 and boot to DOS (press F8 while booting and select the option for "Command Prompt Only").
  152. 3.  Change to your \windows directory, the one with system.dat and user.dat
  153. 4.  For safety, backup system.dat and user.dat as follows:
  154. attrib -s -r -h system.dat
  155. attrib -s -r -h user.dat
  156. copy system.dat system.bak
  157. copy user.dat user.bak
  158. 5.  Export your registry to a file as follows:
  159. regedit /e filename
  160. Note:  This assumes that regedit.exe is in this directory, if not add the proper path to it in the above command (i.e.  c:\util\regedit /e filename)
  161. 6.  Now create a new registry with the following command:
  162. regedit /c filename
  163. Note:  This overwrites your current system.dat and user.dat files, creating new ones with the contents of the file filename.  During this process all wasted space is eliminated.
  164. 7.  Restart Win95 as normal, everything should work normally and your registry files should be smaller than before.
  165. 8.  If anything should go wrong, just exit Win95, restore your registry from the *.bak files created in step 4 and reboot.  
  166. 9.  If all went well, you can delete the *.bak files whenever you think it is safe to do so.
  167.  
  168. HOW TO COMPRESS - Multi User System: - See osr2/Memphis section in Appendix B 
  169.  
  170. Appendix  B - Multi User Systems
  171.  
  172.  
  173. First, if you are setup as a multi users system, only because you did not know better when you installed Win95 and now want to convert to a single user system.  Do the following (this info is extracted from Microsoft Knowledge Base Article Q156826).
  174. Disabling User All Profiles:
  175. 1.  Restart the computer.  At the Windows logon screen, click Cancel.
  176. 2.  In Control Panel, double-click Passwords.
  177. 3.  On the User Profiles tab, click "All users of the PC use the same preferences and desktop", and the click OK
  178. 4.  When you are prompted to restart the computer, do so.
  179. Removing Existing User Profiles:
  180. 1.  Use Registry Editor to remove the following registry key (along with all its subkeys):
  181. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CurrentVersion\ProfileLst
  182.        Quit the Registry Editor after deleting this key.
  183. 2.  Double-click My Computer
  184. 3.  On the View menu, click Options
  185. 4.  On the View tab, click Show All Files, and then click OK
  186. 5.  Use My Computer or Windows Explorer to remove the directory Windows\Profiles and all subdirectories under it.
  187. Note:  I have seen reports that Win95 will not let you delete the Windows\Profiles directory as Microsoft describes and that you have to exit to DOS and then use the DELTREE command to delete it.
  188. If you do this, you are now a single user system and my procedure will work as written.  If you are really a multi user system and need to remain that way, then the following should be read for what it's worth.
  189. Since I do not run a multi user system, what I am presenting here is based solely on what I have read, researched and the logical conclusions that I have draw from such.  I have no intention of setting up my system as a multi user system just to test this information out.  After all this procedure is free and I gain no benefit from distributing it other that helping others out as I was helped when I first started out many years ago (long before there was an IBM PC or Apple or TRS-80).  So with that said, here is what I have to say.
  190. When windows is setup for multi users, a separate user.dat file is created for each individual user in her/his profile directory (i.e. C:\Windows\Profiles\Mary) (see I am not sexist, I used a female directory name).  The user.dat files in such profile sub-directories contain all the info that is specific to only that user, such as desktop preferences, installed software and/or software settings, etc.   On such systems, the user.dat file that is in the windows directory is relatively quite small and just contains the data that is common for all users.  This is just a generalization to give you an idea of what's going on.
  191. In a multiuser system, when a user logs in and runs regedit, what they see is a registry that is a combination of the user.dat in the windows directory (common data) and the info from their own user.dat file (user specific data).  Any data contained in other user's user.dat files is not present.
  192. If my procedure was followed as written, then the user.dat file in the windows directory, would become a new file that now contained the original common data combined with the data from the user who was logged in when the procedure was run.  Obviously this would defeat the purpose of user profiles, because after this happened, all other users would be configured with their own user.dat file combined with this new "combination" user.dat file, instead of the proper common user.dat file.
  193. It seems to me that this problem could be overcome with a few modifications to either my main procedure using the normal Win95 regedit.exe program or the osr2/Memphis regedit.exe procedure in appendix A (remember that this is theory, not tested procedure):
  194.  
  195. Using Win95 regedit.exe
  196. This references the main procedure.
  197. 1.  In step 1 - DO NOT use the supplied smallbac.bat file to make the backups.  Instead create two temporary directories for backups.  In the first directory, backup all files in the windows directory as listed in step 1.  In the second directory backup all files in the user profile directory (for the user will be logging on and running this procedure) that have the same names as those listed in step 1.  At a minimum, you would have a backup copy of user.dat in both backup directories.
  198. 2.  In step 2 - DO NOT modify the MSDOS.SYS file, use the F8 booting method instead
  199. 3.  Run the procedure as written thru step 32, skipping step 27 (not needed, you did not modify your MSDOS.SYS file).
  200. 4.  Add Step 33 - Referring to the list of filenames in step 1, for all files with the same name in both the windows directory, and the user profile directory, copy the ones from the windows directory to the user profile directory if that filename appears in the list in step 1.  I would think that this would only be user.dat.
  201. 5.  Add Step 34 - Restore all files in the windows directory with those from the backups made in step 1.
  202. 6.  The above would have to be repeated for each user that wants to compress her/his user.dat file.
  203. What these procedure modification have done, is to first create a compressed user.dat file in the windows directory for the individual that was logged on, then has you copy the user.dat file to the user profile directory where it belongs, and finally has you restore the original windows directory files.
  204. As I said this is untested theory, if anyone tries it, please let me know how you make out.
  205.  
  206. Using osr2/Memphis regedit.exe
  207. This references the osr2/Memphis procedure in Appendix A.
  208. 1.  Perform step 1 - 9 of the single user procedure.  If all went well proceed on to step 2 to compress the individual user.dat files
  209. 2.  Exit Win95 and boot to DOS (press F8 while booting and select the option for "Command Prompt Only").
  210. 3.  Change to your \windows\profiles\user directory.
  211. 4.  For safety, backup user.dat as follows:
  212. attrib -s -r -h user.dat
  213. copy user.dat user.bak
  214. 5.  Change to your \windows directory
  215. 6.  Backup system.dat and user.dat as follows:
  216. attrib -s -r -h system.dat
  217. attrib -s -r -h user.dat
  218. copy system.dat system.1 (different file extension so the *.bak files are not lost)
  219. copy user.dat user.1
  220. 8.  Overwrite user.dat with the one in \windows\profiles\user as follows:
  221. copy \windows\profiles\user\user.dat user.dat
  222. 8.  Export your registry to a file as follows:
  223. regedit /e filename
  224. 9.  Now create a new registry with the following command:
  225. regedit /c filename
  226. 10.  Copy the new user.dat to \windows\profiles\user as follows
  227. attrib -s -r -h user.dat
  228. copy user.dat \windows\profiles\user\user.dat
  229. 11.  Restore the \windows system.dat and user.dat files as follows:
  230. attrib -s -r -h system.dat
  231. attrib -s -r -h user.dat
  232. copy system.1 system.dat
  233. copy user.1 user.dat
  234. 12.  Restart Win95 as normal, everything should work normally and your registry files should be smaller than before.
  235. 13.  This will have to be repeated for each user's user.dat file that you want to compress.
  236.  
  237. As I said this is untested theory, if anyone tries it, please let me know how you make out.
  238.  
  239. 13
  240.  
  241.  
  242.